// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: "yiyuanfan-0g6e8n6n8ab2decd"
})

// 云函数入口函数
const db = cloud.database()
const _ = db.command
exports.main = async (event, context) => {
  const  id =  event.id;
 const num = event.num;
  // return num;
  try {
    return await db.collection('student').where({
      student_id:id
    })
    .update({
      data:{
        student_status:num
      }
     
    })
    
  } catch(e) {
    console.error(e)
  }
}